home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-13 | 3.5 KB | 118 lines | [TEXT/CWIE] |
- /*
- File: PickerCommon.h
- Copyright: © 1996-1997 by Apple Computer, Inc., all rights reserved.
- */
-
-
- //===============================================================================
- //
- // PickerCommon.h
- //
- //===============================================================================
-
-
- #pragma once
-
-
- #include <QDOffscreen.h>
- #include <Sound.h>
-
-
- #if GENERATINGPOWERPC
-
- #if USE_COMPONENT_PROC_INFO
-
- #define CallComponentFunctionWithStorageUniv(storage, params, funcName) \
- CallComponentFunctionWithStorageProcInfo(storage, params, (ProcPtr)do##funcName, \
- upp##funcName##ProcInfo)
-
- #else // !USE_COMPONENT_PROC_INFO
-
- #define CallComponentFunctionWithStorageUniv(storage, params, funcName) \
- CallComponentFunctionWithStorage(storage, params, &funcName##RD)
-
- #endif // USE_COMPONENT_PROC_INFO
-
- #define CallComponentFunctionUniv(params, funcName) \
- CallComponentFunction(params, &funcName##RD)
- #define INSTANTIATE_ROUTINE_DESCRIPTOR(funcName) \
- RoutineDescriptor funcName##RD = \
- BUILD_ROUTINE_DESCRIPTOR (upp##funcName##ProcInfo, do##funcName)
-
- #else // !GENERATINGPOWERPC
-
- #define CallComponentFunctionWithStorageUniv(storage, params, funcName) \
- CallComponentFunctionWithStorage(storage, params, (ComponentFunctionUPP)do##funcName)
- #define CallComponentFunctionUniv(params, funcName) \
- CallComponentFunction(params, (ComponentFunctionUPP)do##funcName)
-
- #endif // GENERATINGPOWERPC
-
-
- #define kUpArrow 0x1E // Key ID's
- #define kDnArrow 0x1F
- #define kLtArrow 0x1C
- #define kRtArrow 0x1D
- #define kReturn 0x0D
- #define kEnter 0x03
- #define kTab 0x09
- #define kBackSpace 0x08
-
-
- // Handy color-swapping macros.
- #define PMCOLOR2RGBCOLOR(pmColor, rgbColor) \
- rgbColor.red = pmColor.color.rgb.red; \
- rgbColor.green = pmColor.color.rgb.green; \
- rgbColor.blue = pmColor.color.rgb.blue;
-
- #define RGBCOLOR2PMCOLOR(rgbColor, pmColor) \
- pmColor.color.rgb.red = rgbColor.red; \
- pmColor.color.rgb.green = rgbColor.green; \
- pmColor.color.rgb.blue = rgbColor.blue;
-
- #define RGBCOLOREQUALSRGBCOLOR(rgbColorA, rgbColorB) \
- ((rgbColorA.red == rgbColorB.red) && \
- (rgbColorA.green == rgbColorB.green) && \
- (rgbColorA.blue == rgbColorB.blue))
-
- #define HSLCOLOREQUALSHSLCOLOR(hslColorA, hslColorB) \
- ((hslColorA.hue == hslColorB.hue) && \
- (hslColorA.saturation == hslColorB.saturation) && \
- (hslColorA.lightness == hslColorB.lightness))
-
-
- // Exception handling macros
- #define require(assertion, exception) \
- do { \
- if (assertion) ; \
- else { \
- goto exception; \
- } \
- } while (false)
-
- #define require_action(assertion, exception, action) \
- do { \
- if (assertion) ; \
- else { \
- { action } \
- goto exception; \
- } \
- } while (false)
-
- #define check(assertion)
-
-
- // PickerCommonDraw.c
- void DropRectShadow (Rect *, SInt16, Boolean);
- void SetPatternToColor (PixPatHandle pat, RGBColor *rgb, Boolean hasColor);
- void GetGrayPattern (unsigned short, Pattern *);
-
- // PickerCommonUtils.c
- void PasStringCopy (StringPtr, StringPtr);
- Handle HappiNewHandle (Size, OSErr *);
- Handle HappiNewHandleClear (Size, OSErr *);
- Ptr HappiNewPointer (Size, OSErr *);
- Ptr HappiNewPointerClear (Size, OSErr *);
- Handle HappiGetResource (ResType, SInt16, OSErr *);
-
-